package com.woniuxy01;

import java.util.Comparator;

/**
 * @author 作者
 * @create 2025-07-25 10:48
 */
public class StudentNameAsc implements Comparator {

    @Override
    public int compare(Object o1, Object o2) {
        //学生年龄降序排列
        if(o1 instanceof Student && o2 instanceof Student){
           return  ((Student) o1).getName().compareTo( ((Student) o2).getName());
        }

        return 0;
    }
}
